# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

_pyname=dpkt
pkgname=python-${_pyname}
pkgver=1.9.8
pkgrel=2
pkgdesc='Fast, simple packet creation / parsing, with definitions for the basic TCP/IP protocols'
url='https://github.com/kbandla/dpkt'
arch=('any')
license=('custom')
depends=('python')
makedepends=('python-build' 'python-installer' 'python-wheel' 'python-setuptools')
source=("${url}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
sha512sums=('fd0edcca00f3b4ec4da2345ce1efc6da5ac372f39e8d0dd5fa25c2482ab3a9e37f8954dccf5230920c038272decd854abb4fcc8ddbdbbea721c49ce88ffe69d3')
b2sums=('c9ab5503339f6465e799250b7bd482c5bc06a022c19436b9ec334306a7bceb8232274d0ca397614717e19ffd5fdece3760ea7c3cc49703a1a47d55050546da75')

build() {
  cd "${_pyname}-${pkgver}"
  python -m build --wheel --no-isolation
}

package() {
  cd "${_pyname}-${pkgver}"
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim: ts=2 sw=2 et:
